import request from "@/utils/request.ts"
import type { PageModelResult } from '@/api/model/pageParam.ts';
import type { ResultModel } from '@/api/model/ResultModel.ts';
import type { commonStatus } from '@/api/model/CommonStatus.ts';
import type { shopModel } from '@/api/model/shop.ts';


// 条件分页查询
export const queryShopListApi = (shopName : string, shopManagerName : string, status : string, shopStatus : string, page : number, pageSize : number) =>
	request.get<any, PageModelResult>(`/shop?shopName=${shopName}&shopManagerName=${shopManagerName}&shopStatus=${shopStatus}&status=${status}&page=${page}&pageSize=${pageSize}`)

// 新增时先查询有哪些店长
export const queryShopManagerNameApi = (shopManagerName : string) => request.get<any, ResultModel>(`/shop/shopManager?shopManagerName=${shopManagerName}`)


// 新增管理店铺
export const addShopApi = (shops : shopModel) => request.post<any, ResultModel>('/shop', shops)


// 编辑管理(步骤一：回显)
export const getByIdShopApi = (id : number) => request.get<any, ResultModel>(`/shop/${id}`)


// 编辑管理(步骤二：更新管理信息)
export const updateShopApi = (shops : shopModel) => request.put<any, ResultModel>('/shop', shops)


// 删除店铺（批量删除）
export const deleteShopApi = (ids : string) => request.delete<any, ResultModel>(`/shop?ids=${ids}`)

// 修改店铺开启状态（批量）

export const disableShopApi = (shopStatus : commonStatus) => request.put<any, ResultModel>('/shop/status', shopStatus)